stylecontext: Use new snapshot transforms
authorBenjamin Otte <otte@redhat.com>
Thu, 21 Feb 2019 04:34:12 +0000 (05:34 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 21 Feb 2019 18:47:28 +0000 (19:47 +0100)
gtk/gtkstylecontext.c

index 094fe1a29fac5857aec8db0a958a673938c73229..e765c852dc68961077501b7200a82f8d83221c7f 100644 (file)
@@ -1901,25 +1901,27 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot     *snapshot,
         cursor1 = &weak_pos;
     }
 
-  gtk_snapshot_offset (snapshot, x + PANGO_PIXELS (cursor1->x), y + PANGO_PIXELS (cursor1->y));
+  gtk_snapshot_save (snapshot);
+  gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x + PANGO_PIXELS (cursor1->x), y + PANGO_PIXELS (cursor1->y)));
   snapshot_insertion_cursor (snapshot,
                              context,
                              PANGO_PIXELS (cursor1->height),
                              TRUE,
                              direction,
                              direction2 != PANGO_DIRECTION_NEUTRAL);
-  gtk_snapshot_offset (snapshot, - x - PANGO_PIXELS (cursor1->x), - y - PANGO_PIXELS (cursor1->y));
+  gtk_snapshot_restore (snapshot);
 
   if (direction2 != PANGO_DIRECTION_NEUTRAL)
     {
-      gtk_snapshot_offset (snapshot, x + PANGO_PIXELS (cursor2->x), y + PANGO_PIXELS (cursor2->y));
+      gtk_snapshot_save (snapshot);
+      gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x + PANGO_PIXELS (cursor2->x), y + PANGO_PIXELS (cursor2->y)));
       snapshot_insertion_cursor (snapshot,
                                  context,
                                  PANGO_PIXELS (cursor2->height),
                                  FALSE,
                                  direction2,
                                  TRUE);
-      gtk_snapshot_offset (snapshot, - x - PANGO_PIXELS (cursor2->x), - y - PANGO_PIXELS (cursor2->y));
+      gtk_snapshot_restore (snapshot);
     }
 }